const seq = require('../db_connect'),
      { STRING, INT, TEXT, DECIMAL } = require('../../configs/db_type');

const totalCourse = seq.define('total_course', {
  cid: {
    comment: 'course id',
    type: INT,
    allowNull: false,
    unique: true
  },
  href: {
    comment: 'course detail page link',
    type: STRING,
    allowNull: false
  },
  posterImgUrl: {
    comment: 'post image url',
    type: STRING,
    allowNull: false
  },
  courseName: {
    comment: 'course name',
    type: STRING,
    allowNull: false
  },
  price: {
    comment: 'course price',
    type: STRING,
    allowNull: false
  },
  description: {
    comment: 'course description',
    type: TEXT,
    allowNull: false
  },
  studentCount: {
    comment: 'the count of the students who joined the course',
    type: INT,
    allowNull: false
  },
  field: {
    comment: 'the course concerned the tab',
    type: INT,
    defaultValue: 0,
    allowNull: false
  },
  posterImgKey: {
    comment: 'qiniu poster image name',
    type: STRING,
    allowNull: false
  },
  status: {
    comment: 'course status', //控制是否显示
    type: INT,
    defaultValue: 1,
    allowNull: true //设初始值要同时设置非空
  }
})



module.exports = totalCourse;